package com.young.rabbitmq.config;

import org.springframework.amqp.core.Queue;
import org.springframework.amqp.core.QueueBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * 基本队列配置,不设计交换机以及路由键
 */
@Configuration
public class BaseQueueConfig {

    public static final String BASE_QUEUE_NAME = "base_queue";

    @Bean
    public Queue baseQueue(){
        // durable 表示声明的是持久化队列，对应的还有noDurable
        QueueBuilder builder = QueueBuilder.durable(BASE_QUEUE_NAME);
        return builder.build();
    }
}
